#!/bin/sh -e

printf '#define __STRING(x) #x\n' >> include/global.h

./configure \
    --prefix=/usr \
    --without-debug

make
make DESTDIR="$1" install

# Compile the static library. Due to a bug in libtool/alsa-lib you cannot
# compile static and shared libraries together.

make clean

./configure \
    --enable-static=yes \
    --enable-shared=no

make
clinst -Dm644 src/.libs/libasound.a "$1/usr/lib/libasound.a"
